package com.openway.game.field;

/**
 * The direction of movement on the playing field
 *
 * @author Created: 04.03.12 15:56
 * @version $Date$ $Revision$
 */
public enum Direction {
    LEFT, RIGHT, UP, DOWN;

    public Direction getOppositeDirection() {
        switch (this) {
            case RIGHT:
                return LEFT;
            case LEFT:
                return RIGHT;
            case UP:
                return DOWN;
            case DOWN:
                return UP;
            default:     //should never happened
                return null;
        }
    }
}
